package JavaSE.WEBLearning.Page182;

import java.io.IOException;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class SocketTest {
    public static void main(String[] args) {
        try {
            Socket s = new Socket("time-nw.nist.gov", 13);
            Scanner in = new Scanner(s.getInputStream());
            {
                while(in.hasNextLine()) {
                    String line = in.nextLine();
                    System.out.println(line);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
